export function eachPromise(arr, iterator, ...extraArgs) {
    const promiseReducer = (prev, current, idx) => {
        return prev.then(() => iterator(current, idx, ...extraArgs))
    }
    return Array.from(arr).reduce(promiseReducer, Promise.resolve());
}
